<?php
namespace Home\Controller;
use Think\Controller;

class PlayerController extends FuncController {

    function __construct(){
        parent::__construct();

        $this->mdlPlayer = D('player');
    }

    public function index(){
        $player = $this->mdlPlayer->findPlayer($this->userid);

        $player['user_id'] = $this->userid;
        $this->assign('player',$player);

        $this->pDisplay( T('Player/index'), true );
    }

    public function save(){
        $rs = $this->mdlPlayer->savePlayer();
        if (!$rs['status']){
            $this->error($rs['msg'], '', 2);
        }else{
            $this->success($rs['msg'], './index.php?m=Home&c=Player&a=index', 2);
        }
    }

}
